﻿package com.petermacko.utils.validators {
	
	// EmailValidator.isValid("someone@someplace.com");
	public class EmailValidator
	{
		public static const EMAIL_REGEX:RegExp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$/i;

		public function EmailValidator() {
			throw new Error("The EmailValidator class is not intended to be instantiated.");
		}
		public static function isValid(email:String):Boolean {
			return Boolean(email.match(EMAIL_REGEX));
		}
	}
}